﻿import com.mixmedia.net.ILoadStrategy;
import com.mixmedia.mx.IEventDispatcher;
import com.mixmedia.mx.events.LoaderEvent;
/**
 * @author Colin
 */
class com.mixmedia.mx.NetStreamEvt extends NetStream implements IEventDispatcher, ILoadStrategy{
	public var metaDataArray:Array;
	public var cuePointArray:Array;
	
	public function NetStreamEvt(connection:NetConnection){
		super(connection);
		//super.onCuePoint = Delegate.create(this,onCuePoint);
		EventDispatcher.initialize(this);
		metaDataArray = new Array();
		cuePointArray = new Array();
	};

//	public function attachAudio(theMicrophone:Microphone):Void{};
//	public function attachVideo(theCamera:Camera,snapshotMilliseconds:Number):Void{};
//	public function close():Void{};
//	public function pause(flag:Boolean):Void{};
//	public function play(name:Object, start:Number, len:Number, reset:Object):Void{};
//	public function publish(name:Object, type:String):Void{};
//	public function receiveAudio(flag:Boolean):Void{};
//	public function receiveVideo(flag:Object):Void{};
//	public function seek(offset:Number):Void{};
//	public function send(handlerName:String):Void{};
//	public function setBufferTime(bufferTime:Number){};
//	public function onResult(streamId:Number){};
//	public function onStatus(infoObject:Object):Void{};

	private function onCuePoint(obj):Void{
		cuePointArray[obj.time] = {name:obj.name,type:obj.type,parameters:obj.parameters,time:time};
	}
	
	private function onMetaData(obj):Void{
		for(var name in obj){
			metaDataArray.push({name:name,value:obj[name]});	
		}
		dispatchEvent(new LoaderEvent(this,LoaderEvent.EVENTOPEN,this));
	}

	public function getTarget() : Object {
		return this;
	}

	public function load(requestURL : String) : Void {
		super.play(requestURL);
	}
	
	private function dispatchEvent(evt:LoaderEvent) {};
	public function addEventListener(event : String, handler) : Void {}
	public function removeEventListener(event : String, handler) : Void {}
}